import 'package:json_annotation/json_annotation.dart';

part 'user_invited.g.dart';

@JsonSerializable()
class UserInvited {
  final User currentUser;
  final User targetUser;
  final List<User> invitedUsers;

  UserInvited(this.currentUser, this.targetUser, this.invitedUsers);

  factory UserInvited.fromJson(Map<String, dynamic> json) => _$UserInvitedFromJson(json);

  Map<String, dynamic> toJson() => _$UserInvitedToJson(this);
}

@JsonSerializable()
class User {
  final int id;
  final String username;
  final String realName;
  final String userLevel;
  final String avatar;
  final int invitedCount;
  final String storeInfo;
  final String createTime;

  User(
    this.id,
    this.username,
    this.realName,
    this.userLevel,
    this.avatar,
    this.invitedCount,
    this.storeInfo,
    this.createTime,
  );

  factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);

  Map<String, dynamic> toJson() => _$UserToJson(this);
}
